package tds.model1.version1;

import java.util.Scanner;

/**
 * 
 * @Company 杭州先锋电子技术股份有限公司
 * @ClassName CalConsole
 * @Description TODO(简单的加减乘除实现)
 * @author tds
 * @Date 2019年1月7日 上午9:04:59
 * @version 1.0.0
 */
public class CalConsole {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		try {
			System.out.println("输入计算参数1：");
			double param1 = scanner.nextDouble();
			System.out.println("输入操作符：");
			String operator = scanner.next();
			System.out.println("输入计算参数2：");
			double param2 = scanner.nextDouble();
			double result = Calculation.calculate(param1, param2, operator);
			System.out.println("计算结果是：" + result);
		} catch (Exception e) {
			System.out.println("计算出错，出错信息：" + e.getMessage() + "，请检查输入是否正确！");
			e.printStackTrace();
		}
	}
}
